<?php
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');

require('sajax/Sajax.php');

function getPiece($sView, $mArguments, $sHolder) {
	$_REQUEST['sView'] = $sView;
	$sPieces = split('&', $mArguments);
	foreach ($sPieces as $sThisPiece) {
		list($sVarname, $sValue) = split('=', $sThisPiece);
		if ($sVarname == 'undefined') {
			continue;
		}
		$_REQUEST[$sVarname] = $sValue;
	}
	if ($_REQUEST['sAction']) {
		require('include/request.inc.php');
	}
	ob_start();
	loadBox($sView);
	$sHTML = ob_get_contents();
	ob_end_clean();
	return $sView.'|'.$mArguments.'|'.$sHolder.'|'.$sHTML;
}

function showBox($sView, $mArguments) {
	$_REQUEST['sView'] = $sView;
	$sPieces = split('&', $mArguments);
	foreach ($sPieces as $sThisPiece) {
		@list($sVarname, $sValue) = split('=', $sThisPiece);
		if ($sVarname == 'undefined') {
			continue;
		}
		$_REQUEST[$sVarname] = $sValue;
	}
	if (@$_REQUEST['sAction']) {
		require('include/request.inc.php');
	}
	ob_start();
	loadBox($sView);
	if (TRANSLATING_APP === true) {
		loadBox('appconfig-translate', 'sRedirectView='.$_REQUEST['sView']);
	}
	$sHTML = ob_get_contents();
	ob_end_clean();
	return $sHTML;
}

$sajax_request_type = "GET";
$sajax_debug_mode = false;
sajax_init();
sajax_export('showBox', 'getPiece');
sajax_handle_client_request();

echo '<script language="JavaScript">';
sajax_show_javascript();
echo '</script>';
?>
